Public Class importe

    Dim monto As Double
    Dim padre As Mod_ventas


    Public Sub New(ByVal monto As Double, ByRef padre As Mod_ventas)

        InitializeComponent()
        Me.monto = monto
        Me.padre = padre

    End Sub

    Private Sub btnAceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAceptar.Click
        Dim Result As New DialogResult
        Dim pago As Double
        Try
            pago = Double.Parse(Me.txtCantidad.Text)
        Catch ex As Exception
            Return
        End Try
        If monto <= pago Then
            If Me.padre.grabarSalida() Then
                Result = MessageBox.Show("La venta fue realizada con exito", "EVANS", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Me.Close()
            Else
                Result = MessageBox.Show("La venta no pudo realizarse por favor vuelva intentarlo", "EVANS", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Me.Close()
            End If
        Else
            Result = MessageBox.Show("El pago debe cubrir el monto para realizar la venta", "EVANS", MessageBoxButtons.OK, MessageBoxIcon.Information)

        End If
        

    End Sub

    Private Sub btnCancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelar.Click
        Me.Close()
    End Sub

    Private Sub importe_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class